import axios from "@/utils/http";
enum Api {
    permission = "/v1/permission",
}

export interface UserPermission {
    updateTime: string;
    uUID?: string;
    permissionName: string;
    permissionSlot: number;
    parentUUID: string;
    code: string;
}
export interface RespUserPermissionList {
    list: UserPermission[];
    total: number;
}
export interface ListParmas {
    page?: number;
    pageSize?: number;
    keyword: string;
}
// 获取权限列表
export const  List = (params: ListParmas) => {
    return axios.get<RespUserPermissionList>(Api.permission,params);
  };

// 获取权限详情
export const  details = (uuid: string) => {
    return axios.get<UserPermission>(Api.permission + "/" + uuid);
  };

// 更新权限
export const  Update = (params: UserPermission) => {
    return axios.put(Api.permission, params);
  };

// 删除权限
export const  Delete = (uuid:string) => {
    return axios.delete(Api.permission+ "/" + uuid);
  };

// 创建权限
export const  Create = (params: UserPermission) => {
    return axios.post(Api.permission, params);
  };